/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.pbv.azsg.domain;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author b.prikhodko
 */
@Entity
@Table(catalog = "", schema = "PBV")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Fuel.findAll", query = "SELECT f FROM Fuel f"),
    @NamedQuery(name = "Fuel.findById", query = "SELECT f FROM Fuel f WHERE f.id = :id"),
    @NamedQuery(name = "Fuel.findByName", query = "SELECT f FROM Fuel f WHERE f.name = :name")})
public class FuelEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(nullable = false)
    private Long id;
    @Basic(optional = false)
    @Column(nullable = false, length = 100)
    private String name;
    
/**    
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "fuel", fetch = FetchType.LAZY)
    private List<Dispenser> dispenserList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "fuel", fetch = FetchType.LAZY)
    private List<Fuelling> fuellingList;
*/
    public FuelEntity() {
    }

    public FuelEntity(Long id) {
        this.id = id;
    }

    public FuelEntity(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

/**    
    @XmlTransient
    public List<Dispenser> getDispenserList() {
        return dispenserList;
    }

    public void setDispenserList(List<Dispenser> dispenserList) {
        this.dispenserList = dispenserList;
    }

    @XmlTransient
    public List<Fuelling> getFuellingList() {
        return fuellingList;
    }

    public void setFuellingList(List<Fuelling> fuellingList) {
        this.fuellingList = fuellingList;
    }

*/
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FuelEntity)) {
            return false;
        }
        FuelEntity other = (FuelEntity) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.pbv.azsg.domain.Fuel[ id=" + id + " ]";
    }
    
}
